In [1]:
!git clone https://github.com/ChristophKirst/ClearMap.git
In [1]:
## Script used to download nii run on Docker
from ndreg import *
import matplotlib
import ndio.remote.neurodata as neurodata
import nibabel as nb
inToken = "Fear199"
nd = neurodata()
print(nd.get_metadata(inToken)['dataset']['voxelres'].keys())
inImg = imgDownload(inToken, resolution=5)
imgWrite(inImg, "./Fear199.nii")
In [2]:
import os
import numpy as np
from PIL import Image
import nibabel as nib
import scipy.misc
In [3]:
rawData = sitk.GetArrayFromImage(inImg) ## convert to simpleITK image to normal numpy ndarray
print type(rawData)
In [ ]:
plane = 0;
for plane in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15):
output = np.asarray(rawData[plane])
## Save as TIFF for Ilastik
scipy.misc.toimage(output).save('clarity'+str(plane).zfill(4)+'.tif')
/ apt-get install spyder apt-get install python-opencv apt-get install cython apt-get install python-tifffile apt-get install python-h5py apt-get install python-natsort pip install scikit-image/
//Files located at '/root/ClearMap_ressources/25um\ Autofluo\ Reference/template_25.tif ' BaseDirectory = '/root/data' cFosFile = os.path.join(BaseDirectory, 'template25.tif'); AutofluoFile = os.path.join(BaseDirectory, 'template25.tif'); PathReg = '/root/data'; AtlasFile = os.path.join(PathReg, 'regions.csv'); AnnotationFile = os.path.join(PathReg, 'annotation_25_full.nrrd');
/usr/local/lib/python2.7/dist-packages/ClearMap-0.9.2-py2.7-linux-x86_64.egg/ClearMap/ /root/ClearMap/ClearMap/Scripts